package com.nidu.demo.oauth2.convertor;

import com.nidu.demo.base.BaseConvertor;
import com.nidu.demo.convertor.MapStructConfig;
import com.nidu.demo.oauth2.dto.OAuth2ApproveCO;
import com.nidu.demo.oauth2.mapper.dataobject.OAuth2ApproveDO;
import com.nidu.demo.oauth2.model.OAuth2Approve;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

@Mapper(config = MapStructConfig.class)
public interface OAuth2ApproveConvertor extends BaseConvertor<OAuth2ApproveDO, OAuth2Approve, OAuth2ApproveCO> {

    @Override
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    @Mapping(target = "updateBy", ignore = true)
    OAuth2ApproveDO toDataObject(OAuth2Approve token);
}